<template>
    <div class="mui-numbox" data-numbox-min='1'>
        <button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
        <input id="test" class="mui-input-numbox" type="number" value="1" ref="count" @change="countChanged" />
        <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
    </div>
</template>

<script>
    import mui from '../../../../dist/js/mui.min.js'
    export default {
       methods:{
          countChanged(){
              // console.log(this.$refs.count.value);
              this.$emit("getcount",parseInt(this.$refs.count.value));
          }
       },
        watch:{
           max:function (newval, oldval) {
               mui(".mui-numbox").numbox().setOption('max',newval)
           }
    },
        props:["max"]


    }
</script>

<style scoped>

</style>